import ajax from '@/utils/sphRequest';
// 添加或跟新购物车数据
export const reqAddOrUpdateSkuInfoToShopCart = (skuId, skuNum) => ajax.post(`/api/cart/addToCart/${skuId}/${skuNum}`);

// 7. 获取购物车中的商品数据
export const reqGetShopCartListData = () => ajax.get('/api/cart/cartList');

// 8. 更新购物车中商品的选中状态  单选中的选中与否
export const reqUpdateSkuInfoState = (skuID, isChecked) => ajax.get(`/api/cart/checkCart/${skuID}/${isChecked}`)

// 9. 批量更新购物车中商品的选中状态 
export const reqUpdateAllSkuInfoState = (isChecked, skuIdList) => ajax.post(`/api/cart/batchCheckCart/${isChecked}`, skuIdList)


// 订单结算中心接口函数
export const reqGetTradeInfoData = () => ajax.get<any, any>('/api/order/auth/trade')
// 提交订单
export const reqSubmitOrder = (tradeNo: string, params: any) => ajax.post<any, any>(`/api/order/auth/submitOrder?tradeNo=${tradeNo}`, params)
// 订单支付信息
export const reqGetPayQRcode = (orderId: number) => ajax.get<any, any>(`/api/payment/weixin/createNative/${orderId}`)
// 支付状态查询
export const reqGetPayState = (orderId: number) => ajax.get<any, any>(`/api/payment/weixin/queryPayStatus/${orderId}`)